package cn.hwh.springframework.context.support;

import cn.hwh.springframework.beans.BeansException;

import java.util.Map;

/**
 * @author wenhao hu
 * @title: ClassPathXmlApplicationContext
 * @projectName mini-spring
 * @description: TODO
 * @date 2022/1/2621:24
 */
public class ClassPathXmlApplicationContext extends AbstractXmlApplicationContext{

   private String[] configLocations;

   public ClassPathXmlApplicationContext(){}
    /**
     * 从 XML 中加载 BeanDefinition，并刷新上下文
     *
     * @param configLocations
     * @throws BeansException
     */
    public ClassPathXmlApplicationContext(String configLocations)throws BeansException{
       this(new String[]{configLocations});
    }
    /**
     * 从 XML 中加载 BeanDefinition，并刷新上下文
     * @param configLocations
     * @throws BeansException
     */
    public ClassPathXmlApplicationContext(String[] configLocations)throws BeansException{
        this.configLocations = configLocations;
        refresh();
    }

    @Override
    protected String[] getConfigLocations(){
       return configLocations;
    }


}
